﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Edit.aspx.cs" Inherits="PhuongDoAn.Admin.Film.Edit" %>

<%@ Register Assembly="Ext.Net" Namespace="Ext.Net" TagPrefix="ext" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
    <script type="text/javascript">
        //Hàm đóng form và thực hiện thông báo
        function ReloadAddOrEdit() {
            window.top.reportResult('Cập nhật thành công');
            //window.top.reLoadActiveTab();
        }
        function hideForm() {
            window.top.reLoadActiveTab();
        }
        // Hiển thị dữ liệu Decode(Chu y khi sua trang thai ve trang thai da vao so - note)
        var showDataDecode = function () {
            App.txtMovieName.setValue(Ext.String.htmlDecode(App.txtMovieName.getValue()));
            App.txtDirector.setValue(Ext.String.htmlDecode(App.txtDirector.getValue()));

        };
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <ext:ResourceManager ID="ResourceManager1" runat="server" ShowWarningOnAjaxFailure="false">
        <Listeners>
            <DocumentReady Handler="showDataDecode();App.frmEdit.updateLayout();" />
        </Listeners>
    </ext:ResourceManager>
    <ext:Viewport ID="vp" runat="server" Layout="FitLayout">
        <Items>
            <ext:FormPanel ID="frmEdit" runat="server" Title="" MonitorValid="true" ButtonAlign="Right"
                DefaultButton="btnCapNhat" LabelWidth="120" PaddingSummary="5px 5px 0" AutoScroll="true"
                Layout="ColumnLayout" LabelAlign="Right" BodyPadding="5" Border="false">
                <TopBar>
                    <ext:Toolbar ID="tb" runat="server">
                        <Items>
                            <ext:Button ID="btnCapNhat" runat="server" Text="Lưu" Icon="Disk" Before="return #{frmEdit}.isValid();">
                                <DirectEvents>
                                    <Click OnEvent="onSave">
                                        <EventMask ShowMask="true" Msg="Đang thực thi, vui lòng chờ ..." />
                                    </Click>
                                </DirectEvents>
                            </ext:Button>
                            <ext:ToolbarSpacer />
                        </Items>
                    </ext:Toolbar>
                </TopBar>
                <Items>
                    <ext:FieldContainer ID="FieldContainer5" runat="server" HideLabel="true" Layout="ColumnLayout"
                        ColumnWidth="1">
                        <Items>
                            <ext:FieldSet runat="server" ID="FieldSet1" Title="Ảnh đại diện" Collapsible="true"
                                Collapsed="false" ColumnWidth="1">
                                <Defaults>
                                    <ext:Parameter Name="labelWidth" Value="89" Mode="Raw" />
                                </Defaults>
                                <Items>
                                    <%-- <ext:FileUploadField ID="fulField" runat="server" EmptyText="Chọn ảnh" FieldLabel="Ảnh"
                                                ButtonText="" Icon="ImageAdd" ColumnWidth="0.5" LabelAlign="Right" Margins="0 3 0 0" />--%>
                                    <ext:FieldContainer ID="fcpnlAttachment" runat="server" Layout="ColumnLayout" ColumnWidth="1"
                                        LabelAlign="Right">
                                        <Items>
                                            <ext:Panel ID="pnlAttachment" runat="server" Border="false" ColumnWidth="1" Floatable="true">
                                                <Content>
                                                    <table width="100%">
                                                        <tr>
                                                            <td style="font-size: 12pt;">
                                                                <input id="FileField" runat="server" type="file" accept="png|jpg|jpeg|gif" style="width: 400px" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </Content>
                                            </ext:Panel>
                                            <ext:Panel ID="pnViewFile" runat="server" Border="false" ColumnWidth="1" Floatable="true">
                                                <Content>
                                                    <table width="100%">
                                                        <tr>
                                                            <td style="font-size: 12pt;">
                                                                <ext:Label ID="lblEditFile" runat="server" Html="" />
                                                            </td>
                                                        </tr>
                                                    </table>
                                                </Content>
                                            </ext:Panel>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:FieldContainer ID="FieldContainer2" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:Image ImageUrl="" runat="server" ID="img" AlternateText="">
                                            </ext:Image>
                                        </Items>
                                    </ext:FieldContainer>
                                </Items>
                            </ext:FieldSet>
                            <ext:FieldSet runat="server" ID="pnlTaskInfo" Title="Thông tin chung" Collapsible="true"
                                Collapsed="false" ColumnWidth="1">
                                <Defaults>
                                    <ext:Parameter Name="labelWidth" Value="89" Mode="Raw" />
                                </Defaults>
                                <Items>
                                    <ext:FieldContainer ID="fcMovieName" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:TextField MaxLength="50" LabelAlign="Right" Margins="0 3 0 0" FieldLabel="Tên film (<span class='red-text'>*</span>)"
                                                ID="txtMovieName" runat="server" AllowBlank="false" Regex="\S" ColumnWidth="0.5"
                                                PaddingSpec="2 0 2 0" EnableKeyEvents="true">
                                            </ext:TextField>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:FieldContainer ID="FieldContainer6" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:ComboBox ID="cbYear" runat="server" FieldLabel="Năm sản xuất (<span class='red-text'>*</span>)" PaddingSpec="2 0 2 0"
                                                ColumnWidth="0.5" Editable="false" LabelAlign="Right" Margins="0 3 0 0" AllowBlank="false" EmptyText="Chọn năm sản xuất">
                                            </ext:ComboBox>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:FieldContainer ID="fcCountry" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:ComboBox AllowBlank="false" ID="cbCountry" runat="server" FieldLabel="Nước sản xuất (<span class='red-text'>*</span>)"
                                                PaddingSpec="2 0 2 0" ColumnWidth="0.5" Editable="false" LabelAlign="Right" Margins="0 3 0 0"
                                                EmptyText="Chọn nước sản xuất">
                                            </ext:ComboBox>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:FieldContainer ID="fcTime" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:ComboBox ID="cbHour" runat="server" FieldLabel="Giờ" PaddingSpec="2 0 2 0" ColumnWidth="0.15"
                                                Editable="false" LabelAlign="Right" Margins="0 3 0 0">
                                            </ext:ComboBox>
                                            <ext:ComboBox ID="cbMinute" runat="server" FieldLabel="Phút" PaddingSpec="2 0 2 0"
                                                ColumnWidth="0.15" Editable="false" LabelAlign="Right" Margins="0 3 0 0">
                                            </ext:ComboBox>
                                            <ext:ComboBox ID="cbSecond" runat="server" FieldLabel="Giây" PaddingSpec="2 0 2 0"
                                                ColumnWidth="0.15" Editable="false" LabelAlign="Right" Margins="0 3 0 0">
                                            </ext:ComboBox>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:FieldContainer ID="fcDirector" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:TextField MaxLength="50" LabelAlign="Right" Margins="0 3 0 0" FieldLabel="Đạo diễn (<span class='red-text'>*</span>)"
                                                ID="txtDirector" runat="server" AllowBlank="false" Regex="\S" ColumnWidth="0.5"
                                                PaddingSpec="2 0 2 0" EnableKeyEvents="true">
                                            </ext:TextField>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:FieldContainer ID="fcGenre" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:CheckboxGroup ID="chgGenre" runat="server" Cls="x-check-group-alt" FieldLabel="Thể loại"
                                                LabelAlign="Right" Margins="0 3 0 0" ColumnsNumber="2" ColumnWidth="0.5" PaddingSpec="2 0 2 0">
                                            </ext:CheckboxGroup>
                                        </Items>
                                    </ext:FieldContainer>
                                    <ext:FieldContainer ID="FieldContainer3" runat="server" HideLabel="true" Layout="ColumnLayout"
                                        ColumnWidth="1">
                                        <Items>
                                            <ext:Checkbox ID="chkStatus" runat="server" FieldLabel="Trạng thái" Checked="true">
                                            </ext:Checkbox>
                                        </Items>
                                    </ext:FieldContainer>
                                </Items>
                            </ext:FieldSet>
                        </Items>
                    </ext:FieldContainer>
                </Items>
                <BottomBar>
                    <ext:StatusBar ID="FormStatusBar" runat="server">
                        <Plugins>
                            <ext:ValidationStatus ID="ValidationStatus1" runat="server" FormPanelID="frmEdit"
                                ValidIcon="Accept" ErrorIcon="Exclamation" ShowText="[ Dữ liệu nhập chưa đúng ]"
                                HideText="Click ẩn thông báo" />
                        </Plugins>
                    </ext:StatusBar>
                </BottomBar>
                <Listeners>
                    <ValidityChange Handler="#{btnCapNhat}.setDisabled(!valid);" />
                </Listeners>
            </ext:FormPanel>
        </Items>
    </ext:Viewport>
    </form>
</body>
</html>
